package so.sao.code.service.domain.entity;

import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;

import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import lombok.Data;
import so.sao.code.service.infrastructure.enums.TAG_SCRAP_STATUS;
import so.sao.code.service.infrastructure.enums.TAG_SCRAP_TYPE;
import so.sao.code.service.infrastructure.jpa.convert.TagScrapStatusConvert;
import so.sao.code.service.infrastructure.jpa.convert.TagScrapTypeConvert;

@Entity
@Data
@EntityListeners(AuditingEntityListener.class)
public class TagScrap extends BaseEntity {
	private static final long serialVersionUID = -5049007377540475557L;
	/**
	 * 企业id
	 */
	private Long eseId = 0L;
	/**
	 * 企业名
	 */
	private String enterpriseName="";
	/**
	 * 工厂id
	 */
	private Long printFactoryId = 0L;
	/**
	 * 工厂name
	 */
	private String printFactoryName = "";
	
	 /**
     * 终端id（预计没有实际意义，暂时不用）
     */
    private String terminalId ="";
	/**
	 * 报废类型
	 */
	@Convert(converter = TagScrapTypeConvert.class)
	private TAG_SCRAP_TYPE type = TAG_SCRAP_TYPE.SCRAPBYBATCH;
	
	/**
	 * 码序号
	 */
	private Long seqnum = 0L;
	/**
	 * 码段Id
	 */
	private Long  rangeId=0L;
	/**
	 * 批次id
	 */
	private Long tagBatchId = 0L;
	/**
	 * 批次name
	 */
	private String  tagBatchName = "";
	/**
	 * 标签批次起始序号
	 */
	private Long seqnumStart = 0L;
	/**
	 * 标签批次结束序号
	 */
	private Long seqnumEnd = 0L;
	/**
	 * 标签报废数量
	 */
	private Long tagScrapCount = 0L;
	
	/**
	 * 登记产品id
	 */
	private Long productId = 0L;
	/**
	 * 登记产品name
	 */
	private String productName ="";
	/**
	 * 操作人name
	 */
	 private String userName="";
	/**
	 * 报废状态
	 */
	@Convert(converter = TagScrapStatusConvert.class)
	private TAG_SCRAP_STATUS status = TAG_SCRAP_STATUS.SCRAPSUCCESS;
	
	/**
	 * 报废原因
	 */
	 private String tagScrapReason="";
	
}
